#define _CRT_SECURE_NO_WARNINGS 1

#include <iostream>
using namespace std;
#include <stdlib.h>

class Stack
{
public:
	/*Stack()
	{
		cout << "Stack()" << endl;
		_a = (int*)malloc(sizeof(int) * 4);
		if (_a == nullptr)
		{
			cout << "malloc fail" << endl;
			return;
		}
		
		_top = 0;
		_capacity = 4;
	}*/

	Stack(int InitSize = 4)
	{
		cout << "Stack(int InitSize)" << endl;
		_a = (int*)malloc(sizeof(int) * InitSize);
		if (_a == nullptr)
		{
			cout << "malloc fail" << endl;
			return;
		}

		_top = 0;
		_capacity = InitSize;
	}

	Stack(Stack& st)
	{
		cout << "Stack(Stack& st)" << endl;
		_a = (int*)malloc(sizeof(int) * st._capacity);
		if (_a == nullptr)
		{
			cout << "malloc fail" << endl;
			return;
		}

		memcpy(_a, st._a, sizeof(int) * st._top);
		_top = st._top;
		_capacity = st._capacity;
	}

	~Stack()
	{
		cout << "~Stack" << endl;
		if (_a!= nullptr)
		{
			free(_a);
			_a = nullptr;
			_top = _capacity = 0;
		}
	}

private:
	int* _a;
	int _top;
	int _capacity;
};

class Data
{
public:
	/*Data()
	{
		cout << "Data()" << endl;
		_year = 2025;
		_month = 7;
		_day = 8;
	}

	Data(int year, int month, int day)
	{
		cout << "Data(int year, int month, int day)" << endl;
		_year = year;
		_month = month;
		_day = day;
	}*/

	/*Data(Data& d)
	{
		_year = d._year;
		_month = d._month;
		_day = d._day;
	}*/

	~Data()
	{
		cout << "~Data" << endl;
		_year = _month = _day = 0;
	}

private:
	int _year;
	int _month;
	int _day;
};

class MyQueue
{
private:
	Stack pushst;
	Stack popst;
};

int main()
{
	//Stack st1;
	//Stack st2(10);

	//Data d1;
	//Data d2(2024, 7, 8);

	MyQueue q1;

	return 0;
}

//int main()
//{
//	/*Stack st1;
//	Stack st2(st1);
//
//	MyQueue q1;
//	MyQueue q2(q1);*/
//
//	Data d1(2023,9,1);
//	Data d2(d1);
//
//	return 0;
//}
